#pragma once

#include "stdafx.h"

class CLoggedEvent : public QObject
{
	Q_OBJECT;
private:
	QString m_name;
	QString m_details;
	static unsigned int nextId;
	unsigned int m_id;

public:
	enum EventType
	{
		FATALERROR,
		ERROR,
		WARNING,
		INFO,
		PROGRESS,
		COMPLETE
	};

	CLoggedEvent();
	CLoggedEvent(const CLoggedEvent& copy);
	CLoggedEvent(EventType type, QString name, QString details);
	virtual ~CLoggedEvent(void);

	inline QString GetName() const { qDebug("LoggedEvent[0x%08x]::GetName", this); return m_name; };
	inline QString GetDetails() const { qDebug("LoggedEvent[0x%08x]::GetDetails", this); return m_details; };
	void SetName(const QString& name);
	inline unsigned int GetId() const { qDebug("LoggedEvent[0x%08x]::GetId", this); return m_id; };

	void UpdateMessage(QString message);
	void UpdateStatus(EventType type);

signals:
	void StateUpdated(CLoggedEvent* self);

private:
	EventType m_event;

public:
	EventType GetType() const { qDebug("LoggedEvent[0x%08x]::GetType", this);; return m_event; };
	void SetType(EventType type);
};
